<?php /* Smarty version Smarty-3.1.18, created on 2017-02-20 17:02:18
         compiled from "Finance/views/user/details.html" */ ?>
<?php /*%%SmartyHeaderCode:87776993458aab09acd7a78-77704967%%*/if(!defined('SMARTY_DIR')) exit('no direct access allowed');
$_valid = $_smarty_tpl->decodeProperties(array (
  'file_dependency' => 
  array (
    '34cb39f61f815d5fd062ae14266c78f0232168d1' => 
    array (
      0 => 'Finance/views/user/details.html',
      1 => 1487574483,
      2 => 'file',
    ),
  ),
  'nocache_hash' => '87776993458aab09acd7a78-77704967',
  'function' => 
  array (
  ),
  'variables' => 
  array (
    'end_time' => 0,
  ),
  'has_nocache_code' => false,
  'version' => 'Smarty-3.1.18',
  'unifunc' => 'content_58aab09ad09869_05614520',
),false); /*/%%SmartyHeaderCode%%*/?>
<?php if ($_valid && !is_callable('content_58aab09ad09869_05614520')) {function content_58aab09ad09869_05614520($_smarty_tpl) {?><?php echo $_smarty_tpl->getSubTemplate ("public/header.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
 
                <script src="/static/public/jquery.datetimepicker.js"></script>
                <link rel="stylesheet" type="text/css" href="/static/public/jquery.datetimepicker.css">
		<script src="/static/public/jquery.pagination.js" type="text/javascript" charset="utf-8"></script>
		<!--main部分-->
		<div class="x-main-upper w1180-con">
			<!--main--左边--logo/tab-->
			<?php echo $_smarty_tpl->getSubTemplate ("public/user_nav.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
 
				<!--main--右边--banner-->
				<div class="main-right">
					<div class="mright-content">
						<!--头像、昵称、等级-->
						<?php echo $_smarty_tpl->getSubTemplate ("public/user_top.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
 			
						<div class="clear"></div>
						<!--溜溜币明细-->
						<div class="cash66 mt15">
							<!--title-->
							<div class="title">
								<div class="vertical"></div><p class="title66">溜溜币明细</p>
								<!--日期选择-->
							</div>
							<!--溜溜币明细-->
							<div class="choice-code mt15">
								<select class="fl" id="finance_type">
								  <option value="0" selected="selected">全部</option>
								  <option value="1">收入</option>
								  <option value="2">支出</option>
								</select>
								<div class="fr">
									<div class="date fl">起始日期</div>	
                                                                        <input type="text" id="finance_start_date" class="date_picker" readonly="readonly" placeholder="点击选择日期"/>
									-
                                                                        <input type="text" id="finance_end_date" class="date_picker" readonly="readonly" placeholder="点击选择日期" value="<?php echo $_smarty_tpl->tpl_vars['end_time']->value;?>
"/>
								</div>	
								<div class="clear"></div>
							</div>
							<div class="clear"></div>
							<!--溜溜币明细content-->
							<div class="cash-code mt15">
								<table class="liuliu-detail">
									<tr>
										<th>发生时间</th>
										<th>发生事件</th>
										<th>发生类型</th>
										<th>溜溜币变化</th>
									</tr>
                                                                        <tbody id="finance_content">
                                                                        </tbody>
								</table>
									
								<!-- 页码navigation holder -->
								<div id="finance_pagination" class="holder"></div>	
                                                                <script type="text/javascript">
                                                                    $(function(){
                                                                        showFinancePage(0);
                                                                        $("#finance_type").change(function(){
                                                                            showFinancePage(0);
                                                                        });
                                                                        $('#finance_start_date').datetimepicker({
                                                                            format:'Y-m-d',
                                                                            closeOnDateSelect: true,
                                                                            lang:'zh',
                                                                            timepicker:false,
                                                                            onChangeDateTime:function(){
                                                                                showFinancePage(0);
                                                                            },onShow:function( ct ){
                                                                                this.setOptions({
                                                                                    maxDate:$('#finance_end_date').val()?$('#finance_end_date').val():false
                                                                                })
                                                                            }
                                                                        });
                                                                        $('#finance_end_date').datetimepicker({
                                                                            format:'Y-m-d',
                                                                            closeOnDateSelect: true,
                                                                            lang:'zh',
                                                                            timepicker:false,
                                                                            onChangeDateTime:function(){
                                                                                showFinancePage(0);
                                                                            },onShow:function( ct ){
                                                                                this.setOptions({
                                                                                    maxDate:$('#finance_start_date').val()?$('#finance_start_date').val():false
                                                                                })
                                                                            }
                                                                        });
                                                                        
                                                                    });
                                                                    function handleFinancePage(resp){
                                                                        var str = "";
                                                                        var totalCount = resp.data.totalCount;
                                                                        var list = resp.data.list;
                                                                        if(totalCount == 0){
                                                                            str += "<tr><td colspan='8'>暂无数据</td></tr>"
                                                                        }
                                                                        
                                                                        $.each(list,function(index,data){
                                                                            var type = "";
                                                                            var temp = "";
                                                                            if(data.type == 1){
                                                                                type = "收入";
                                                                                temp += "<td class='green'>+"+data.finance+"</td>"
                                                                            }else{
                                                                                type = "支出";
                                                                                temp += "<td class='orange'>-"+data.finance+"</td>"
                                                                            }
                                                                            str += "<tr><td>"+data.create_time+"</td><td>"+data.content+"</td><td>"+type+"</td>"+temp+"</tr>";
                                                                        });
                                                                        $("#finance_content").html(str);
                                                                        financePage(totalCount,resp.data.pageIndex);
                                                                    }
                                                                    function showFinancePage(pageIndex,jq){
                                                                        var params = {};
                                                                        var type = $("#finance_type").val();
                                                                        var start_date = $("#finance_start_date").val();
                                                                        var end_date = $("#finance_end_date").val();
                                                                        params.start_date = start_date != "" ? start_date : "";
                                                                        params.end_date = end_date != "" ? end_date : "";
                                                                        params.pageIndex = pageIndex;
                                                                        params.type = type;
                                                                        doPageRequest("/user/detail_finance.html",params,false,handleFinancePage,errorCallback);
                                                                    }
                                                                    
                                                                    function financePage(total,pageIndex){
                                                                        $("#finance_pagination").pagination(total, { //recordCount在后台定义的一个公有变量，通过从数据库查询记录进行赋值，返回记录的总数
                                                                        callback: showFinancePage,  //点击分页时，调用的回调函数
                                                                        prev_text: '<',  //显示上一页按钮的文本
                                                                        next_text: '>',  //显示下一页按钮的文本
                                                                        link_to:"javascript:void(0);",
                                                                        items_per_page:5,  //每页显示的项数
                                                                        num_display_entries:6,  //分页插件中间显示的按钮数目
                                                                        current_page:pageIndex,  //当前页索引
                                                                        num_edge_entries:2  //分页插件左右两边显示的按钮数目
                                                                        });
                                                                    }
                                                                </script>
							</div>
						</div>
				<!--积分明细-->
                                <div class="cash66 mt15" style="display: none;">
							<!--title-->
							<div class="title">
								<div class="vertical"></div><p class="title66">积分明细</p>
								<!--日期选择-->
							</div>
							<!--积分明细choice-->
							<div class="choice-code">
                                                            <select class="fl" id="experience_type">
								  <option value="0" selected="selected">全部</option>
								  <option value="1">收入</option>
								  <option value="2">支出</option>
								</select>
								<div class="fr">
									<div class="date fl">起始日期</div>	
									<input type="text" id="experience_start_date" class="date_picker" readonly="readonly" placeholder="点击选择日期"/>
									-
									<input type="text" id="experience_end_date" class="date_picker" readonly="readonly" placeholder="点击选择日期" value="<?php echo $_smarty_tpl->tpl_vars['end_time']->value;?>
"/>
								</div>
								<div class="clear"></div>
							</div>
							<div class="clear"></div>
							<!--积分明细content-->
							<div class="cash-code mt15">
								<table class="liuliu-detail">
									<tr>
										<th>发生时间</th>
										<th>发生事件</th>
										<th>发生类型</th>
										<th>积分变化</th>
									</tr>									
									<tbody id="experience_content">
										<tr>
                                                                                    <td>16-05-10</td>
                                                                                    <td>签到增加30溜溜币</td>
                                                                                    <td>收入</td>
                                                                                    <td class="green">+80</td>
										</tr>
									</tbody>	
								</table>
								<!-- 页码navigation holder -->
                                                                <div id="experience_pagination" class="holder"></div>	
                                                                <script type="text/javascript">
                                                                    $(function(){
                                                                        showExperiencePage(0);
                                                                        $("#experience_type").change(function(){
                                                                            showExperiencePage(0);
                                                                        });
                                                                        $('#experience_start_date').datetimepicker({
                                                                            format:'Y-m-d',
                                                                            closeOnDateSelect: true,
                                                                            lang:'zh',
                                                                            timepicker:false,
                                                                            onChangeDateTime:function(){
                                                                                showExperiencePage(0);
                                                                            },onShow:function( ct ){
                                                                                this.setOptions({
                                                                                    maxDate:$('#experience_end_date').val()?$('#experience_end_date').val():false
                                                                                })
                                                                            }
                                                                        });
                                                                        $('#experience_end_date').datetimepicker({
                                                                            format:'Y-m-d',
                                                                            closeOnDateSelect: true,
                                                                            lang:'zh',
                                                                            timepicker:false,
                                                                            onChangeDateTime:function(){
                                                                                showExperiencePage(0);
                                                                            },onShow:function( ct ){
                                                                                this.setOptions({
                                                                                    maxDate:$('#experience_start_date').val()?$('#experience_start_date').val():false
                                                                                })
                                                                            }
                                                                        });
                                                                        
                                                                    });
                                                                    function handleExperiencePage(resp){
                                                                        var str = "";
                                                                        var totalCount = resp.data.totalCount;
                                                                        var list = resp.data.list;
                                                                        if(totalCount == 0){
                                                                            str += "<tr><td colspan='8'>暂无数据</td></tr>"
                                                                        }
                                                                        
                                                                        $.each(list,function(index,data){
                                                                            var type = "";
                                                                            var temp = "";
                                                                            if(data.type == 1){
                                                                                type = "收入";
                                                                                temp += "<td class='green'>+"+data.experience+"</td>"
                                                                            }else{
                                                                                type = "支出";
                                                                                temp += "<td class='orange'>-"+data.experience+"</td>"
                                                                            }
                                                                            str += "<tr><td>"+data.create_time+"</td><td>"+data.content+"</td><td>"+type+"</td>"+temp+"</tr>";
                                                                        });
                                                                        $("#experience_content").html(str);
                                                                        experiencePage(totalCount,resp.data.pageIndex);
                                                                    }
                                                                    function showExperiencePage(pageIndex,jq){
                                                                        var params = {};
                                                                        var type = $("#experience_type").val();
                                                                        var start_date = $("#experience_start_date").val();
                                                                        var end_date = $("#experience_end_date").val();
                                                                        params.start_date = start_date != "" ? start_date : "";
                                                                        params.end_date = end_date != "" ? end_date : "";
                                                                        params.pageIndex = pageIndex;
                                                                        params.type = type;
                                                                        doPageRequest("/user/detail_experience.html",params,false,handleExperiencePage,errorCallback);
                                                                    }
                                                                    
                                                                    function experiencePage(total,pageIndex){
                                                                        $("#experience_pagination").pagination(total, { //recordCount在后台定义的一个公有变量，通过从数据库查询记录进行赋值，返回记录的总数
                                                                        callback: showExperiencePage,  //点击分页时，调用的回调函数
                                                                        prev_text: '<',  //显示上一页按钮的文本
                                                                        next_text: '>',  //显示下一页按钮的文本
                                                                        link_to:"javascript:void(0);",
                                                                        items_per_page:5,  //每页显示的项数
                                                                        num_display_entries:6,  //分页插件中间显示的按钮数目
                                                                        current_page:pageIndex,  //当前页索引
                                                                        num_edge_entries:2  //分页插件左右两边显示的按钮数目
                                                                        });
                                                                    }
                                                                </script>
							</div>
							<div class="clear"></div>
						</div>	
					</div>
				</div>
			</div>
		</div>
		<div class="clear"></div>
		<!--footer-->
                <!--页码-->
                
<?php echo $_smarty_tpl->getSubTemplate ("public/footer.html", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, null, array(), 0);?>
 		<?php }} ?>
